/*
ID: simplyz2
LANG: C
TASK: friday
*/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

const int days[][12] = {
	{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
	{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};
int num, count[7]; /* start with 'Saturday' */

int
is_leap(year)
{
	if((year%400==0) || (year%100!=0 && year%4==0))
		return 1;
	return 0;
}

void
solve()
{
	int i, j, leap, total, begin = 1900;
	total = 0;
	for(i=0; i<num; i++) { /* year */
		leap = is_leap(begin+i);
		for(j=0; j<12; j++) { /* month */
			total += 13;
			++count[((total%7)+8)%7];
			total -= 13;
			total += days[leap][j];
		}
	}

	for(i=0; i<7; i++) 
		printf("%d%s", count[i], i==6?"":" ");
	printf("\n");
}

int
main(int argc, char **argv)
{
	freopen("friday.in", "r", stdin);
	freopen("friday.out", "w", stdout);
	while(scanf("%d", &num) != EOF) {
		memset(count, 0, sizeof(count));
		solve();
	}
	exit(0); /* Remember, or you'll get Execution error */
}
